a,b=input("请输入鸡和兔的总数与腿数：").split( )
a = int (a)
b = int (b)
for x in range (a+1):
    if 2*x + 4*(a-x) == b:
        print ("鸡{}只 兔{}只".format(x,a-x))
input('press any key to continue...')